package cn.tedu.hospitalgroupproject.server.content.service.impl;

import cn.tedu.hospitalgroupproject.server.content.dao.persist.repository.IHealthyReportRepository;
import cn.tedu.hospitalgroupproject.server.content.pojo.entity.HealthyReport;
import cn.tedu.hospitalgroupproject.server.content.pojo.param.HealthyReportAddNewParam;
import cn.tedu.hospitalgroupproject.server.content.service.IHealthyReportService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
@Slf4j
public class HealthyReportServiceImpl implements IHealthyReportService {

    @Autowired
    private IHealthyReportRepository healthyReportRepository;

    public HealthyReportServiceImpl() {
        log.info("创建健康报告对象:HealthyReportServiceImpl");
    }

    @Override
    public void addNew(HealthyReportAddNewParam healthyReportAddNewParam) {
        log.debug("开始处理[新增健康报告]的业务,参数:{}",healthyReportAddNewParam);
        HealthyReport healthyReport=new HealthyReport();
        BeanUtils.copyProperties(healthyReportAddNewParam,healthyReport);

        healthyReportRepository.insert(healthyReport);
    }
}
